import {wxUtils} from "../wx/wxUtils";

const {ccclass, property} = cc._decorator;

@ccclass
export default class Rank extends cc.Component {

  @property(cc.Sprite)
  openDataContext: cc.Sprite = null;

  private _texture: cc.Texture2D = new cc.Texture2D();

  onLoad() {
    this._texture.initWithElement(wxUtils.getSharedCanvas());
    this.openDataContext.spriteFrame = new cc.SpriteFrame(this._texture)
  }

  close() {
    wxUtils.postMessage({cmd: 'disableRankList'});
    cc.director.loadScene('menu');
  }

  update(dt) {
    this._texture.handleLoadedTexture();
  }
}
